// 添加症状详细信息到页面中
function symptomInfo(symptom_info){
  var symptom = document.getElementById("symptom"),
     brief = document.getElementById("brief"),
     cause = document.getElementById("cause"),
     check = document.getElementById("check"),
     diagnose = document.getElementById("diagnose"),
     prevent = document.getElementById("prevent"),
     r_disease = document.getElementById("r_disease"),
     r_symptom = document.getElementById("r_symptom");
  symptom.innerHTML = symptom_info["症状"];
  if (symptom_info["概述"]==""){
    brief.parentNode.style.display = "none";
  }else {
    data = symptom_info["概述"].split('\n');
    for (i in data){
      var p = document.createElement('p');
      p.innerHTML = data[i];
      brief.appendChild(p);
    }
  }
  if (symptom_info["病因"]==""){
    cause.parentNode.style.display = "none";
  }else {
    data = symptom_info["病因"].split('\n');
    for (i in data){
      var p = document.createElement('p');
      p.innerHTML = data[i];
      cause.appendChild(p);
    }
  }
  if (symptom_info[""]==""){
    check.parentNode.style.display = "none";
  }else {
    data = symptom_info["检查"].split('\n');
    for (i in data){
      var p = document.createElement('p');
      p.innerHTML = data[i];
      check.appendChild(p);
    }
  }
  if (symptom_info[""]==""){
    diagnose.parentNode.style.display = "none";
  }else {
    data = symptom_info["诊断"].split('\n');
    for (i in data){
      var p = document.createElement('p');
      p.innerHTML = data[i];
      diagnose.appendChild(p);
    }
  }
  if (symptom_info[""]==""){
    prevent.parentNode.style.display = "none";
  }else {
    data = symptom_info["预防"].split('\n');
    for (i in data){
      var p = document.createElement('p');
      p.innerHTML = data[i];
      prevent.appendChild(p);
    }
  }
  if (symptom_info[""]==""){
    r_disease.parentNode.style.display = "none";
  }else {
    data = symptom_info["可能患有的疾病"];
    for (i in data){
      var a = document.createElement('a');
      var dis = document.createElement('div');
      var sym = document.createElement('div');
      a.className = "row col-xs-12 symptom-r-disease-a";
      a.href = "disease.html"
      a.style = "text-decoration:none;cursor: pointer;outline: none;"
      dis.className = "row symptom-r-disease-name";
      dis.innerHTML = data[i]["疾病"];
      sym.className = "row symptom-r-disease-symptom";
      sym.innerHTML = "常见症状：" + data[i]["相关症状"];
      a.appendChild(dis);
      a.appendChild(sym);
      r_disease.appendChild(a);
    }
  }
  if (symptom_info["常见症状"]==""){
    r_symptom.parentNode.style.display = "none";
  }else {
    data = symptom_info["常见症状"];
    for (i in data){
      var a = document.createElement('a');
      a.className = "symptom-r-symptom";
      a.href = "symptom.html"
      a.style = "text-decoration:none;cursor: pointer;outline: none;"
      a.innerHTML = data[i];
      r_symptom.appendChild(a);
    }
  }
}
// var symptom_list = [{
//   "症状": "肺内病变",
//   "概述": "\t肺内病变指肺的内部发生了病理性变化，导致肺内组织发生坏死，影响到了肺的正常功能。病名。肺脏的各种病证。由外邪侵袭，或痰饮内聚，或肺气肺阴不足所致，亦可因其他脏腑、血脉病证传变而致。\n\r\n\t病因不明确，物理、生物、化学因素都可以引起肺内病变。结核，肺癌都是肺内病变的典型疾病。什么是肺病？肺病是指在外感或内伤等因素影响下，造成肺脏功能失调和病理变化的一类病证。肺炎是由多种病原体(如细菌、病毒、真菌、寄生虫等)引起的肺实质的炎症，其他如放射线、化学、过敏因素等亦能引肺炎四季皆可发病，而多发于冬春两季。\n\t肺内病变指肺的内部发生了病理性变化，导致肺内组织发生坏死，影响到了肺的正常功能。病名。肺脏的各种病证。由外邪侵袭，或痰饮内聚，或肺气肺阴不足所致，亦可因其他脏腑、血脉病证传变而致。\n\t病因不明确，物理、生物、化学因素都可以引起肺内病变。结核，肺癌都是肺内病变的典型疾病。什么是肺病？肺病是指在外感或内伤等因素影响下，造成肺脏功能失调和病理变化的一类病证。肺炎是由多种病原体(如细菌、病毒、真菌、寄生虫等)引起的肺实质的炎症，其他如放射线、化学、过敏因素等亦能引肺炎四季皆可发病，而多发于冬春两季。"
// }];
// 添加症状简单信息到网页中
function addSymptom(symptom_list){
   for(var j = 0; j < 5; j++) {
     for(var i in symptom_list)
       var big_box = document.getElementById("symptom");
       var newA = document.createElement("a");
       var small_box = document.createElement("div");
       var title = document.createElement("div");
       var brief = document.createElement("div");
       newA.href = 'symptom.html';
       newA.style = "text-decoration:none";
       small_box.className = "row my-small-box";
       title.className = "row title";
       title.innerHTML = symptom_list[i]["症状"];
       brief.className = "row brief";
       brief.innerHTML = symptom_list[i]["概述"];
       small_box.appendChild(title);
       small_box.appendChild(brief);
       newA.appendChild(small_box);
       big_box.appendChild(newA);
   }
}
